/*
 * @Description:
 * @Version: 1.0
 * @Author: liguansheng
 * @Date: 2022-08-24 10:13:58
 * @LastEditors: liguansheng
 * @LastEditTime: 2022-08-29 14:15:03
 */

export interface IApiResourceClaim {
  apiResourceId: string
  type: string
}

export interface IApiResourceProperty {
  apiResourceId: string
  key: string
  value: string
}

export interface IApiResourceScope {
  apiResourceId: string
  scope: string
}

export interface IApiResourceSecret {
  apiResourceId: string
  description: string
  expiration: Date
  type: string
  value: string
}

export interface IApiResource {
  id: string
  name: string
  displayName: string
  properties: IApiResourceProperty[]
  userClaims: IApiResourceClaim[]
  showInDiscoveryDocument: boolean
  allowedAccessTokenSigningAlgorithms: string
  description: string
  enabled: boolean
  scopes: IApiResourceScope[]
  secrets: IApiResourceSecret[]
  extraProperties: {}
}

export interface ICreateApiResourceClaim {
  type: string
}

export interface ICreateApiResource {
  name: string
  displayName: string
  description: string
  showInDiscoveryDocument: boolean
  allowedAccessTokenSigningAlgorithms: string
  userClaims: ICreateApiResourceClaim[]
}

export interface IUpdateUserClaim {
  type: string
}
export interface IUpdateProperty {
  key: string
  value: string
}
export interface IUpdateScope {
  scope: string
}
export interface IUpdateSecret {
  type: string
  value: string
  description: string
  expiration?: Date
}
export interface IUpdateApiResource {
  displayName: string
  description: string
  showInDiscoveryDocument: boolean
  allowedAccessTokenSigningAlgorithms: string
  enabled: boolean
  userClaims: IUpdateUserClaim[]
  properties: IUpdateProperty[]
  scopes: IUpdateScope[]
  secrets: IUpdateSecret[]
}
